package com.markerhub.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.markerhub.entity.HealthKnowledge;
import com.markerhub.mapper.HealthKnowledgeMapper;
import com.markerhub.service.HealthKnowledgeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author jsx on 2023/1/27
 **/
@Service
public class HealthKnowledgeServiceImpl extends ServiceImpl<HealthKnowledgeMapper, HealthKnowledge> implements HealthKnowledgeService {

    @Autowired
    HealthKnowledgeMapper healthKnowledgeMapper;

    @Override
    public Page<HealthKnowledge> getlist(Page page, String food, String type) {
        return this.healthKnowledgeMapper.selectList(page,food,type);
    }

    @Override
    public int saveAllKnowledge(List<HealthKnowledge> healthKnowledgeList) {
        return this.healthKnowledgeMapper.insertAll(healthKnowledgeList);
    }

    @Override
    public List<HealthKnowledge> getAll() {
        return this.healthKnowledgeMapper.selectAllList();
    }

}
